Skip to main content

setCollateral

readonly setCollateral!: (
collateral: CanResolveToUTxO,
collateralOutput?: ITxOut
) => TxBuilderRunner

Sets the collateral input, and optionally output, for a transaction.

If this method is not used, but the transaction needs collateral due to the presence of a plutus script, the TxBuilderRunner instance will try to use one of the normal inputs as collateral, see setCollateralAmount for more infos.

collateral can either be a resolved UTxO or an unresolved ITxOutRef

in case it is an unresolved ITxOutRef a call to the ITxRunnerProvider resolveUtxos method is done in the build method; if resolveUtxos is missing on the provider the build method will throw an Error.

an additional collateralOutput may be specified.

returns a reference to the same TxBuilderRunner.